/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "infraspecificepithet")
@NamedQueries({
    @NamedQuery(name = "Infraspecificepithet.findAll", query = "SELECT i FROM Infraspecificepithet i"),
    @NamedQuery(name = "Infraspecificepithet.findByIdinfraspecificepithet", query = "SELECT i FROM Infraspecificepithet i WHERE i.idinfraspecificepithet = :idinfraspecificepithet"),
    @NamedQuery(name = "Infraspecificepithet.findByInfraspecificepithet", query = "SELECT i FROM Infraspecificepithet i WHERE i.infraspecificepithet = :infraspecificepithet")})
public class Infraspecificepithet implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idinfraspecificepithet")
    private Integer idinfraspecificepithet;
    @Basic(optional = false)
    @Column(name = "infraspecificepithet")
    private String infraspecificepithet;
    @OneToMany(mappedBy = "infraspecificepithet", fetch = FetchType.LAZY)
    private List<Taxonomicelement> taxonomicelementList;

    public Infraspecificepithet() {
    }

    public Infraspecificepithet(Integer idinfraspecificepithet) {
        this.idinfraspecificepithet = idinfraspecificepithet;
    }

    public Infraspecificepithet(Integer idinfraspecificepithet, String infraspecificepithet) {
        this.idinfraspecificepithet = idinfraspecificepithet;
        this.infraspecificepithet = infraspecificepithet;
    }

    public Integer getIdinfraspecificepithet() {
        return idinfraspecificepithet;
    }

    public void setIdinfraspecificepithet(Integer idinfraspecificepithet) {
        this.idinfraspecificepithet = idinfraspecificepithet;
    }

    public String getInfraspecificepithet() {
        return infraspecificepithet;
    }

    public void setInfraspecificepithet(String infraspecificepithet) {
        this.infraspecificepithet = infraspecificepithet;
    }

    public List<Taxonomicelement> getTaxonomicelementList() {
        return taxonomicelementList;
    }

    public void setTaxonomicelementList(List<Taxonomicelement> taxonomicelementList) {
        this.taxonomicelementList = taxonomicelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idinfraspecificepithet != null ? idinfraspecificepithet.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Infraspecificepithet)) {
            return false;
        }
        Infraspecificepithet other = (Infraspecificepithet) object;
        if ((this.idinfraspecificepithet == null && other.idinfraspecificepithet != null) || (this.idinfraspecificepithet != null && !this.idinfraspecificepithet.equals(other.idinfraspecificepithet))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Infraspecificepithet[idinfraspecificepithet=" + idinfraspecificepithet + "]";
    }

}
